package com.example.shopping.authority.controller;

import com.example.shopping.JsonResult;
import com.example.shopping.authority.entity.QuanXian;
import com.example.shopping.authority.mapper.QuanXianMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/api/Mirmission")
public class QuanXianController {

    @Autowired
    QuanXianMapper quanXianMapper;

    @GetMapping("/list")
    //查询所有权限
    public JsonResult getMirmissionList() {
        List<QuanXian> goods = quanXianMapper.getMirmissionList();
        return new JsonResult(true, "查询成功", goods);
    }

    @GetMapping("/listfind")
    //查询所有权限
    public JsonResult getMirmissionFind(String psids) {
        System.out.println(psids);
        List<QuanXian> goods = quanXianMapper.getMirmissionFind(psids);
        return new JsonResult(true, "查询成功", goods);
    }
}
